@extends('layouts.admin')
@section('css')
  <link href="{{ asset('admin/assets/advanced-datatable/media/css/demo_page.css') }}" rel="stylesheet" />
  <link href="{{ asset('admin/assets/advanced-datatable/media/css/demo_table.css') }}" rel="stylesheet">
  <link href="{{ asset('admin/assets/bootstrap-datepicker/css/datepicker.css') }}" rel="stylesheet">
  <link href="{{ asset('admin/assets/bootstrap-daterangepicker/daterangepicker-bs3.css') }}" rel="stylesheet">
@endsection
@section('content')
<section id="main-content">
  <section class="wrapper">
      <!-- page start-->
      <div class="row">
          <div class="col-lg-12">
              <section class="panel">
                  <header class="panel-heading">
                      【{{ $activity->name }}】【<span class="label {{ $activity->statuslabel() }} label-mini"> {!! $activity->status() !!}</span>】订单详情
                  </header>
                  <div class="panel-body right"  align="right">
                              
                             

                          </div>
                  <!-- <table class="table table-striped table-advance table-hover"> -->
                  <div class="panel-body">
                                <div class="adv-table">
                  <table  class="display table table-bordered table-striped" id="reply">
                      <thead>
                      <tr>
                          <th> ID</th>
                          <th>用户</th>
                          <th>股票名称</th>
                          <th>股票代码</th>
                          <th>下单金额</th>
                          <th>支付金额</th>
                          <th>开盘价</th>
                          <th>收盘价</th>
                          <th>涨幅</th>
                          <th>商户单号</th>
                          <!-- <th>支付单号</th> -->
                          <th>支付时间</th>
                          <th>状态</th>
                          <!-- <th>创建时间</th> -->
                          <th>更新时间</th>
                          <th>操作</th>
                      </tr>
                      </thead>
                      <tbody>
                      @foreach($orders as $order)
                      <tr>
                          <th> {{ $order->id }}</th>
                          <th> {{ $order->user->mobile }}</th>
                          <th> {{ $order->stock_name }}</th>
                          <th> {{ $order->stock_code }}@if( $order->reward() ) <span class="badge bg-important">{{ $order->reward()->money }}</span> @endif</th>
                          <th >￥{{ $order->money }}</th>
                          <th >￥{{ $order->pay_money }}</th>
                          <th>{{ $order->open_price }}</th>
                          <th>{{ $order->close_price }}</th>
                          <th>{{ $order->yield }}</th>
                          <th>{{ $order->out_trade_no }}</th>
                          <!-- <th>{{ $order->transaction_id }}</th> -->
                          <th>{{ $order->payment_time }}</th>
                          <th><span class="label {{ $order->statuslabel() }} label-mini"> {!! $order->status() !!}</span></th>
                          <!-- <th>{{ $order->created_at }}</th> -->
                          <th>{{ $order->updated_at }}</th>
                        
                          <th>
                           
                             <!--  <button class="btn btn-primary btn-xs transfer" data-href="{{ route('admin.finance.withdrawals.transfer',['id'=>$order->id]) }}">转账</button>
                              <button class="btn btn-info btn-xs enterprise" data-href="{{ route('admin.finance.withdrawals.enterprise',['id'=>$order->id]) }}">企业</button> -->
                              <button class="btn btn-danger btn-xs back" data-href="{{ route('admin.stock.orders.back',['id'=>$order->id]) }}">退回</button>
                          </th>

                          
                      </tr>
                      @endforeach

                      </tbody>
                  </table>
                 </div>
                          </div>
              </section>
          </div>
      </div>
      <!-- page end-->
  </section>
</section>
@endsection
@section('javascript')
<script type="text/javascript" language="javascript" src="{{ asset('admin/assets/advanced-datatable/media/js/jquery.dataTables.js') }}"></script>
<script type="text/javascript" src="{{ asset('admin/assets/bootstrap-datepicker/js/bootstrap-datepicker.js') }}"></script>
<script type="text/javascript" src="{{ asset('admin/assets/bootstrap-daterangepicker/daterangepicker.js') }}"></script>
 <script src="{{ asset('admin/js/advanced-form-components.js') }}"></script>
 <script type="text/javascript" charset="utf-8">
      
      $(document).ready(function() {
          $('#reply').dataTable( {
              "aaSorting": [[ 4, "desc" ]],
              "oLanguage": {
                   "oPaginate": {
                     "sLast": "最后一页",
                     "sNext":"下页",
                     "sPrevious":"上页",
                     "sEmptyTable":"表里没有数据",
                   },
                   "sInfo": " _START_ - _END_ / _TOTAL_ 条记录",
                   "sLengthMenu": "显示 _MENU_ 条记录",
                   "sSearch": "搜索:",
                 }
          } );
      } );

        $(".transfer").click(function () {
            Rbac.ajax.withdrawals({
                confirmTitle: '确定要执行银联转账处理吗?',
                href: $(this).data('href'),
                successTitle: '处理成功'
            });
        });

        $(".enterprise").click(function () {
            Rbac.ajax.withdrawals({
                confirmTitle: '确定要执行企业付款处理吗?',
                href: $(this).data('href'),
                successTitle: '处理成功'
            });
        });

        $(".back").click(function () {
            Rbac.ajax.withdrawals({
                confirmTitle: '确定要执行退款处理吗?',
                href: $(this).data('href'),
                successTitle: '处理成功'
            });
        });

        $(".deleteall").click(function () {
            Rbac.ajax.deleteAll({
                confirmTitle: '确定删除选中的期权?',
                href: $(this).data('href'),
                successTitle: '删除成功'
            });
        });
    
      
  </script>  
@endsection

